<template>
  <div >
 <input type="text" @keydown.enter="fn"><br>
 <input type="text" name="" id="" v-model="values" @keydown.enter="fn2">
  </div>
</template>

<script>
export default{
  data(){
    return{
     values:''
    }
  },
  methods:{
    fn(e){
      console.log('按下确认键',e);
    },
    fn2(){
          console.log(this.values);

    }
  }

}

</script>

<style>

</style>
